# -*- coding: utf-8 -*-
# !/usr/bin/env python
from utils.mysql_utils import query_to_list


def query_hosts_soft(host_id=''):
    sql_parameter = []

    if host_id:
        sql_fragment = "WHERE a.host_id = %s"
        sql_parameter.append(host_id)
    else:
        sql_fragment = ''

    sql = """
    SELECT *
    FROM soft_management a
    %s
    AND status = 1
    """%sql_fragment
    data = query_to_list(sql, sql_parameter, False)

    return data
